/**
 * com.avidys.app.checkyoursite.client
 * checkyoursite
 * Prefs.java
 * @date 17-May-09
 * Avidys Inc. 2009
 */
package com.avidys.gwt.wom.client;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;


/**
 * Prefs Preferences emulating Gadget Preferences
 * @author jd
 * @date 17-May-09
 * TODO
 */
public class Prefs {

	// Not used; enum replaced by String
	public enum Frequency {f10, f30, f60};
	public enum Method {http, ping, traceroute};
	String[] prefs = {"mySite","www.","Http","80","30 min"};
	// "name" 
	public String name = prefs[0];
	// "Site url"
	public String url = prefs[1];
	// "Method" 
	public String method = prefs[2]; // Method.http
	// "Port" 
	public String port = prefs[3];
	// "Frequency"
	public String frequency = prefs[4]; // Frequency.f30; 
	
	FlexTable t ;
	public Prefs(){
		// Create a table with a checklist of all options based on preferences
		Panel p = new VerticalPanel();
		p.setWidth("100%");

		FlexTable ft = new FlexTable();

		int index = 0;
		for (String dish : prefs) {
			TextBox cb = new TextBox();
			final String dishCopy = dish;
			cb.addClickHandler (new ClickHandler() {
				public void onClick(ClickEvent event) {
				}
			});
			ft.setWidget(index, 0, cb);
			ft.setHTML(index, 1, dish);
			index++;
		}
		p.add(ft);
	}

}
